Monospace and fallback fonts tweaks #486
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Text: fix possible overflow with "white-space: pre"
Since #454, text in PRE could overflow the PRE width. Fix that.
Fonts: getFontFileNameAndFaceIndex(): return family type
As crengine/FreeType can't distinguish sans serif from serif, this is only useful to detect if a font is monospace or not. Might be useful for frontends.
See koreader/koreader#9211 (comment).
Fonts: account for _bias in Font hash
Should trigger a rerendering when we change the bias of some fonts.
Also fix
GetFontListHash()
which was always returning 0 since ages...epub.css, fb2.css: remove hardcoded monospace font names
This should allow another monospace font, set with a bias, to be used for
<pre>
and<code>
(as with anything havingfont-family: monospace
).Fonts: allow scaling monospace fonts
So that when using a main font with a small x-height, one can avoid having tall inline
<code>
bits, and adjust them (manually) to fit the size of the main font or to be a bit smaller to help distinguishing them.See koreader/koreader#9211.
Fonts: allow adjusting fallback font sizes to x-height
Having all fallback font size having the same x-height should make lowercase letters picked from them less noticable (this can be noticable with greek words, as latin fonts often have only a subset of greek letters, related to maths).
See koreader/koreader#9211 (comment).
HTML parser: trust xml encoding before html charset
EPUBs can have both, and it seems that doing it per XHTML specs is the right thing to do.
See koreader/koreader#8306 (comment) , https://www.w3.org/TR/xhtml1/#C_9
With all this, KOReader will get 2 new menu items in
Font settings>
:This change is